/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sirtet.tetris.program;

import sirtet.tetris.TetrisPiece;
import sirtet.tetris.generator.*;

/**
 * Main program that enumerates all pieces and print in System.out
 * @author guangwei.zhu
 */
public class PieceEnumerator {
    
    /**
     * Main entry of the program.
     * @param args One argument indicating the number of squares in each piece
     * is expected from command-line.
     */
    public static void main(String args[]) {
        
        if (args.length != 1)
        {
            System.err.println("Usage: java sirtet.tetris.main." +
                    "PieceEnumeratorProgram <number>");
            return;
        }
        
        int numsquare = Integer.valueOf(args[0]);
        for (TetrisPiece piece : TetrisPieceGenerator.enumerate(numsquare))
        {
            System.out.println(piece);  // Display the piece
        }
    }
}
